package com.jhs.kjs.dto;

import java.util.Calendar;
import java.util.Date;

public class DestinationExtDTO extends DestinationDTO {
	private String passed;
	private String passedDate;
	private CarDestinationDTO carDesDTO = new CarDestinationDTO();
	
	public void setCarArrivalDate(Date carArrivalDate){
		carDesDTO.setArrivalDate(carArrivalDate);
	}
	public Date getCarArrivalDate(){
		return carDesDTO.getArrivalDate();
	}
	/**
	 * 추후 변경되어야 할 로직
	 * @return
	 */
	public String getPassed() {
		switch(super.getCheckType()){
		case 0 :{
			break;
		}
		case 1 :{
			break;
		}
		case 2 :{
			break;
		}
		}
		
		if(getCarArrivalDate()==null || super.getArrivalDate()==null){
			return "날짜정보 없음";
		}
		int comp = getCarArrivalDate().compareTo(super.getArrivalDate()); 
		passed = (comp>=0)?"통과":"미통과";
		return passed;
	}
	public void setPassed(String passed) {
		this.passed = passed;
	}
	
	/**
	 * 추후 변경되어야 할 로직
	 * @return
	 */
	public Date getDestiniDate(){
		Calendar cal = Calendar.getInstance();
		switch(super.getCheckType()){
		case 0 :{
			cal.setTime(super.getArrivalDate());
			break;
		}
		case 1 :{
			cal.setTime(super.getArrivalDate());
			break;
		}
		case 2 :{
			
			return super.getArrivalDate();
		}
		}
		return cal.getTime();
	}
	public String getPassedDate() {
		return passedDate;
	}
	public void setPassedDate(String passedDate) {
		this.passedDate = passedDate;
	}
	
	
}
